package com.example.fragment.dummy;

import androidx.annotation.NonNull;

import com.example.fragment.R;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class ExerciseContent {
    public static final List<Exercise> ITEMS = new ArrayList<>();

    static {
        for (int i = 0; i < 15; i++) {
            Exercise exercise = new Exercise();
            exercise.setId(i + 1);
            switch (i) {
                case 0:
                    exercise.setTitle("第1章 Android基础入门");
                    exercise.setSubTitle("共计5题");
                    exercise.setBackground(R.mipmap.ic_exercise_bg_1);
                    break;
                case 1:
                    exercise.setTitle("第2章 Android常用布局");
                    exercise.setSubTitle("共计9题");
                    exercise.setBackground(R.mipmap.ic_exercise_bg_2);
                    break;
                case 2:
                    exercise.setTitle("第3章 Android常用控件");
                    exercise.setSubTitle("共计11题");
                    exercise.setBackground(R.mipmap.ic_exercise_bg_1);
                    break;
                case 3:
                    exercise.setTitle("第4章 Activity和Fragment");
                    exercise.setSubTitle("共计15题");
                    exercise.setBackground(R.mipmap.ic_exercise_bg_2);
                    break;
                case 4:
                    exercise.setTitle("第5章 数据存储");
                    exercise.setSubTitle("共计12题");
                    exercise.setBackground(R.mipmap.ic_exercise_bg_1);
                    break;
                case 5:
                    exercise.setTitle("第6章 内容提供者");
                    exercise.setSubTitle("共计5题");
                    exercise.setBackground(R.mipmap.ic_exercise_bg_2);
                    break;
                case 6:
                    exercise.setTitle("第7章 广播接收者");
                    exercise.setSubTitle("共计6题");
                    exercise.setBackground(R.mipmap.ic_exercise_bg_1);
                    break;
                case 7:
                    exercise.setTitle("第8章 服务");
                    exercise.setSubTitle("共计5题");
                    exercise.setBackground(R.mipmap.ic_exercise_bg_2);
                    break;
                case 8:
                    exercise.setTitle("第9章 网络编程");
                    exercise.setSubTitle("共计10题");
                    exercise.setBackground(R.mipmap.ic_exercise_bg_1);
                    break;
                case 9:
                    exercise.setTitle("第10章 Material Design基础");
                    exercise.setSubTitle("共计8题");
                    exercise.setBackground(R.mipmap.ic_exercise_bg_2);
                    break;
                case 10:
                    exercise.setTitle("第11章 基于位置的服务");
                    exercise.setSubTitle("共计3题");
                    exercise.setBackground(R.mipmap.ic_exercise_bg_1);
                    break;
                case 11:
                    exercise.setTitle("第12章 Material Design实战");
                    exercise.setSubTitle("共计5题");
                    exercise.setBackground(R.mipmap.ic_exercise_bg_2);
                    break;
                case 12:
                    exercise.setTitle("第13章 高级技巧");
                    exercise.setSubTitle("共计6题");
                    exercise.setBackground(R.mipmap.ic_exercise_bg_1);
                    break;
                case 13:
                    exercise.setTitle("第14章 项目发布上线");
                    exercise.setSubTitle("共计4题");
                    exercise.setBackground(R.mipmap.ic_exercise_bg_2);
                    break;
                case 14:
                    exercise.setTitle("第15章 综合项目实战");
                    exercise.setSubTitle("共计5题");
                    exercise.setBackground(R.mipmap.ic_exercise_bg_1);
                    break;
                default:
                    break;
            }
            ITEMS.add(exercise);
        }
    }

    public static class Exercise implements Serializable {
        private int id;
        private String title;
        private String subTitle;
        private int background;  // 题目标题的背景

        private String bgColor;

        public String getBgColor() {
            return bgColor;
        }

        public void setBgColor(String bgColor) {
            this.bgColor = bgColor;
        }


        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getSubTitle() {
            return subTitle;
        }

        public void setSubTitle(String subTitle) {
            this.subTitle = subTitle;
        }

        public int getBackground() {
            return background;
        }

        public void setBackground(int background) {
            this.background = background;
        }


        @NonNull
        @Override
        public String toString() {
            return "Exercise{" +
                    "id=" + id +
                    ", title='" + title + '\'' +
                    ", subTitle='" + subTitle + '\'' +
                    ", background=" + background +
                    ", bgColor='" + bgColor + '\'' +
                    '}';
        }

    }

}
